<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Stimulus360.Controllers.Projects.SubmitDocumentViewModel>" %>
<%@ Import Namespace="Stimulus360.Models.Cms" %>
<%@ Import Namespace="Stimulus360.Models.Data.CustomTypes" %>
<%@ Import Namespace="System.Globalization" %>
<%@ Import Namespace="Stimulus360.Services" %>
<%@ Import Namespace="Stimulus360.Controllers" %>
<%@ Import Namespace="Stimulus360.Models.Data"%>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
  <%ProjectSummary project = Model.ProjectSummary;
      RatingViewModel ratingViewModel = new RatingViewModel
      {
          Id = project.ProjectId,
          AverageRating = project.AverageRating,
          IsDisabled = true,
          IdeaId = project.ProjectId
      }; %>
      <%Html.RenderPartial("ProjectDetailLeftNavigation", Model.ProjectSummary); %>
      
    <% using (Html.BeginForm("SubmitDocument", "Projects", FormMethod.Post, new { @enctype = "multipart/form-data", @id = "DocumentUploadForm" })) 
       {%>
        <div class="mainInner colViewHdr">
            <div class="projListItem p10">
                <h1><%=project.ProjectTitle%></h1>
                <div class="projStatusBar mt10">
                    <div class="floatLeft pt02">
                        <%=project.SubmittedDate.ToString("D", CultureInfo.CreateSpecificCulture("en-US"))%> | PM: <%=project.Submitter%></div>
                    <div class="projStatus floatLeft pl10">
                        <div>
                            <%Html.RenderPartial("Rating", ratingViewModel); %>
                        </div>
                        <div class="separatorR">
                            (<%=project.UserRatingsCount%>)</div>
                        <div class="separatorR pt02">
                            Favorites <%=project.FavoritesCount %></div>
                     <div class="projStatusRpt">
                            <h4>
                                Status:
                            </h4>
                            <div>
			            <%= Html.Image(project.StatusString.ToLower() + ".png", project.StatusString)%></div>
			            <div class="statusWdth">
			            <%= project.StatusString %></div>
                        <br clear="all" />
                    </div>
                        <br clear="all" />
                    </div>
                </div>
            </div>
            <br clear="all" />
            <h3>Submit Document</h3>
            <div class="errorMessages"><%= Html.ValidationSummary(Stimulus360.Resources.Stimulus360.ValidationSummary_MandatoryDetails)%></div>

            <div class="projListItemBg">
                <div class="pb5 pt10">
                    <strong>Title</strong></div>
                <div>
                    <%=Html.TextBox("Title", Model.Document.Title, new { @class = "initialfocus", @tabindex = "2", @value = "", @size = "70", @maxlength = "50" })%>
                    <%= Html.ValidationMessage("Title", "*", new { @class = "requiredfield" })%>
                </div>
                <div class="pt10 pb5">
                    <strong>Description:</strong></div>
                <div>
                    <%=Html.TextArea("Description", Model.Document.Description, new { @cols = "70", @rows = "10", @tabindex = "3" })%>
                    <div class="pb5 pt10">
                        <strong>Select Document to upload </strong><span class="note">Allowed Formats: (pdf, docx and doc)</span>
                    </div>
                    <div>
                        <input type="file" name="DocPath" id="DocPath" size="40" />
                        <%= Html.ValidationMessage("DocPath", "*", new { @class = "requiredfield" })%>
                        <%= Html.ValidationMessage("Format", "*", new { @class = "requiredfield" })%>
                    </div>
                    <br />
                    <div class="buttons">
                      <input name="submit" type="submit" class="btTxt submit" id="saveForm" value="Upload" />
                      &nbsp;
                      <input name="Cancel" type="button" class="btTxt submit" id="cancelForm" value="Cancel" />
                    </div>  
                </div>
                <br clear="all" />
            </div>
            <br clear="all" />
            <br />
        </div>
        <br clear="all" />
    <%} %>   
<script language="javascript" type="text/javascript">
    $(document).ready(function() {
        $(".initialfocus").focus();
        $("#documentsTag").click();
        $("#cancelForm").click(function() {
            window.location = "/Projects/" + '<%=Model.ProjectSummary.ProjectId %>' + "/Documents";
        });
    });
</script>

</asp:Content>

